package com.example.demo.service;

import com.example.demo.mapper.BlogMapper;
import com.example.demo.model.BlogInfo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class BlogService {
    @Resource
    private BlogMapper blogMapper;

    public List<BlogInfo> getAll(){
        return blogMapper.getAll();
    }

    public BlogInfo showBlogByBlogId(Integer blogId){
        return  blogMapper.showBlogByBlogId(blogId);
    }

    public int delBlog(Integer blogId){
        return blogMapper.delBlog(blogId);
    }

    public int insertBlog(String title,String content,Integer userId){
        return blogMapper.insertBlog(title,content,userId);
    }
}
